#coding:utf-8
'''
Created on 2016-7-5

@author: root
'''
import base64
import json
import urllib2

from app import api

from flask import request, redirect, make_response, session
from app.utils.toolfunc import getSecretCookie, setSecretCookie


class add_api_resource:
    """装饰器方法，指定API的资源地址
    """
    
    def __init__(self,*args,**kw):
        """初始化装饰器参数
        """
        self.args = args
        self.kwards = kw
        
    def __call__(self,resource):
        """添加资源到路径中
        """
        api.add_resource(resource,*self.args,**self.kwards)
        return resource
